package study.dubbo.springcloud.consumer.controller;

import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import study.dubbo.api.service.EchoService;
import study.dubbo.springcloud.consumer.support.result.Result;
import study.dubbo.springcloud.consumer.support.result.Results;

@Slf4j
@RestController
public class EchoController {

    @DubboReference
    private EchoService echoService;

    @RequestMapping("/echo")
    public Result echo() {
        String msg = echoService.echo("wangzhj");
        log.info("{}", msg);
        return Results.ok();
    }
}
